<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>上机练习4-分页带条件查询学生信息</title>
</head>
<body>
    <button id="btn">获取数据</button>
    <script>
        btn.onclick = function(){
            //01.创建ajax对象
            let xhr = new XMLHttpRequest()
            //02.初始化参数
            xhr.open('GET', 'http://119.45.221.185:81/Student/GetStudnetsConditionPages');
            //03.发送请求
            xhr.send()
            //04.获取数据
            xhr.onreadystatechange = function () {
                //判断请求状态
                if (xhr.readyState === 4) {
                    //判断状态编码
                    if(xhr.status >= 200 && xhr.status<400){
                        console.log(xhr.response);
                    }
                }
            }
        }
    </script>
</body>
</html>